package com.tiantianfresh.admin.service.Impl;

import com.tiantianfresh.model.dao.OrderMapper;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author FANGAO
 * @date 2021/12/9 - 下午 22:43
 */
@Component
public class TimedTask {
    @Resource
    private OrderMapper orderMapper;
    //定时删除过期订单
    @Scheduled(cron = "0 0/5 * * * ?")
    public void deleteOrderBeOverdue(){
        orderMapper.deleteOrderBeOverdue();
    }
}
